package com.pkx.cloud.fse7.dms.openpic.service.impl;

import com.pkx.cloud.fse7.dms.openpic.entity.OpenPic;
import com.pkx.cloud.fse7.dms.openpic.feign.OpenPicFeign;
import com.pkx.cloud.fse7.dms.openpic.repo.OpenPicMapper;
import com.pkx.cloud.fse7.dms.openpic.service.OpenPicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 * 门禁 服务实现类
 *
 * @author ly
 * @since 2020-10-14
 */
@Service
public class OpenPicServiceImpl extends ServiceImpl<OpenPicMapper, OpenPic> implements OpenPicService {

    @Autowired
    private OpenPicFeign openPicFeign;
    /**
     * 分页列表
     *
     * @param openPic
     * @return
     */
    @Override
    public Page<OpenPic> pageList(Page page, OpenPic openPic) {
        LambdaQueryWrapper<OpenPic> lambdaQueryWrapper = Wrappers.lambdaQuery(OpenPic.class);
        return page(page, lambdaQueryWrapper);
    }

    /**
     * 列表查询
     *
     * @param openPic
     * @return
     */
    @Override
    public List<OpenPic> listByEntity(OpenPic openPic) {
        LambdaQueryWrapper<OpenPic> lambdaQueryWrapper = Wrappers.lambdaQuery(OpenPic.class);
        return list(lambdaQueryWrapper);
    }

    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public OpenPic selectById(Long id) {
        return getById(id);
    }

    @Override
    public String add(OpenPic openPic) {
        return openPicFeign.add(openPic);
    }

    @Override
    public String update(OpenPic openPic) {
        return openPicFeign.update(openPic);
    }

    @Override
    public String delete(String id) {
        return openPicFeign.delete(id);
    }


}
